<?xml version="1.0"?>

<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->

<!DOCTYPE window [
<!ENTITY % scratchpadDTD SYSTEM "chrome://devtools/locale/scratchpad.dtd" >
 %scratchpadDTD;
<!ENTITY % editMenuStrings SYSTEM "chrome://global/locale/editMenuOverlay.dtd">
%editMenuStrings;
<!ENTITY % sourceEditorStrings SYSTEM "chrome://devtools/locale/sourceeditor.dtd">
%sourceEditorStrings;
]>

<?xml-stylesheet href="chrome://global/skin/global.css"?>
<?xml-stylesheet href="chrome://devtools/skin/scratchpad.css"?>
<?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?>

<window id="main-window"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        title="&window.title;"
        windowtype="devtools:scratchpad"
        macanimationtype="document"
        fullscreenbutton="true"
        screenX="4" screenY="4"
        width="640" height="480"
        persist="screenX screenY width height sizemode">

<script type="application/javascript;version=1.8"
        src="chrome://devtools/content/shared/theme-switching.js"/>
<script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
<script type="application/javascript" src="chrome://devtools/content/scratchpad/scratchpad.js"/>

<commandset id="editMenuCommands"/>

<commandset id="sourceEditorCommands">
  <command id="cmd_find" oncommand=";"/>
  <command id="cmd_findAgain" oncommand=";"/>
  <command id="cmd_gotoLine" oncommand=";"/>
</commandset>

<commandset id="sp-commandset">
  <command id="sp-cmd-newWindow" oncommand=";"/>
  <command id="sp-cmd-openFile" oncommand=";"/>
  <command id="sp-cmd-clearRecentFiles" oncommand=";"/>
  <command id="sp-cmd-save" oncommand=";"/>
  <command id="sp-cmd-saveas" oncommand=";"/>
  <command id="sp-cmd-revert" oncommand=";" disabled="true"/>
  <command id="sp-cmd-close" oncommand=";"/>
  <command id="sp-cmd-line-numbers" oncommand=";"/>
  <command id="sp-cmd-wrap-text" oncommand=";"/>
  <command id="sp-cmd-highlight-trailing-space" oncommand=";"/>
  <command id="sp-cmd-larger-font" oncommand=";"/>
  <command id="sp-cmd-smaller-font" oncommand=";"/>
  <command id="sp-cmd-normal-font" oncommand=";"/>
  <command id="sp-cmd-run" oncommand=";"/>
  <command id="sp-cmd-inspect" oncommand=";"/>
  <command id="sp-cmd-display" oncommand=";"/>
  <command id="sp-cmd-pprint" oncommand=";"/>
  <command id="sp-cmd-contentContext" oncommand=";"/>
  <command id="sp-cmd-browserContext" oncommand=";" disabled="true"/>
  <command id="sp-cmd-reloadAndRun" oncommand=";"/>
  <command id="sp-cmd-evalFunction" oncommand=";"/>
  <command id="sp-cmd-errorConsole" oncommand=";" disabled="true"/>
  <command id="sp-cmd-webConsole" oncommand=";"/>
  <command id="sp-cmd-documentationLink" oncommand=";"/>
  <command id="sp-cmd-hideSidebar" oncommand=";"/>
</commandset>

<keyset id="editMenuKeys"/>

<keyset id="sp-keyset">
  <key id="sp-key-window"
       key="&newWindowCmd.commandkey;"
       command="sp-cmd-newWindow"
       modifiers="accel"/>
  <key id="sp-key-open"
       key="&openFileCmd.commandkey;"
       command="sp-cmd-openFile"
       modifiers="accel"/>
  <key id="sp-key-save"
       key="&saveFileCmd.commandkey;"
       command="sp-cmd-save"
       modifiers="accel"/>
  <key id="sp-key-close"
       key="&closeCmd.key;"
       command="sp-cmd-close"
       modifiers="accel"/>
  <key id="sp-key-larger-font"
       key="&largerFont.commandkey;"
       command="sp-cmd-larger-font"
       modifiers="accel"/>
  <key key="&largerFont.commandkey2;"
       command="sp-cmd-larger-font"
       modifiers="accel"/>
  <key id="sp-key-smaller-font"
       key="&smallerFont.commandkey;"
       command="sp-cmd-smaller-font"
       modifiers="accel"/>
  <key id="sp-key-normal-size-font"
       key="&normalSize.commandkey;"
       command="sp-cmd-normal-font"
       modifiers="accel"/>
  <key id="sp-key-run"
       key="&run.key;"
       command="sp-cmd-run"
       modifiers="accel"/>
  <key id="sp-key-inspect"
       key="&inspect.key;"
       command="sp-cmd-inspect"
       modifiers="accel"/>
  <key id="sp-key-display"
       key="&display.key;"
       command="sp-cmd-display"
       modifiers="accel"/>
  <key id="sp-key-pprint"
       key="&pprint.key;"
       command="sp-cmd-pprint"
       modifiers="accel"/>
  <key id="sp-key-reloadAndRun"
       key="&reloadAndRun.key;"
       command="sp-cmd-reloadAndRun"
       modifiers="shift,alt"/>
  <key id="sp-key-evalFunction"
       key="&evalFunction.key;"
       command="sp-cmd-evalFunction"
       modifiers="accel"/>
  <key id="sp-key-errorConsole"
       key="&errorConsoleCmd.commandkey;"
       command="sp-cmd-errorConsole"
       modifiers="accel,shift"/>
  <key id="sp-key-hideSidebar"
       keycode="VK_ESCAPE"
       command="sp-cmd-hideSidebar"/>
  <key id="key_openHelp"
       keycode="VK_F1"
       command="sp-cmd-documentationLink"/>
  <key id="key_gotoLine"
       key="&gotoLineCmd.key;"
       command="key_gotoLine"
       modifiers="accel"/>

</keyset>

<menubar id="sp-menubar">
  <menu id="sp-file-menu" label="&fileMenu.label;" accesskey="&fileMenu.accesskey;">
    <menupopup id="sp-menu-filepopup">
      <menuitem id="sp-menu-newscratchpad"
                label="&newWindowCmd.label;"
                accesskey="&newWindowCmd.accesskey;"
                key="sp-key-window"
                command="sp-cmd-newWindow"/>
      <menuseparator/>

      <menuitem id="sp-menu-open"
                label="&openFileCmd.label;"
                command="sp-cmd-openFile"
                key="sp-key-open"
                accesskey="&openFileCmd.accesskey;"/>

      <menu id="sp-open_recent-menu" label="&openRecentMenu.label;"
            accesskey="&openRecentMenu.accesskey;"
            disabled="true">
        <menupopup id="sp-menu-open_recentPopup"/>
      </menu>

      <menuitem id="sp-menu-save"
                label="&saveFileCmd.label;"
                accesskey="&saveFileCmd.accesskey;"
                key="sp-key-save"
                command="sp-cmd-save"/>
      <menuitem id="sp-menu-saveas"
                label="&saveFileAsCmd.label;"
                accesskey="&saveFileAsCmd.accesskey;"
                command="sp-cmd-saveas"/>
      <menuitem id="sp-menu-revert"
                label="&revertCmd.label;"
                accesskey="&revertCmd.accesskey;"
                command="sp-cmd-revert"/>
      <menuseparator/>

      <menuitem id="sp-menu-close"
                label="&closeCmd.label;"
                key="sp-key-close"
                accesskey="&closeCmd.accesskey;"
                command="sp-cmd-close"/>
    </menupopup>
  </menu>

  <menu id="sp-edit-menu" label="&editMenu.label;"
        accesskey="&editMenu.accesskey;">
    <menupopup id="sp-menu_editpopup">
      <menuitem id="menu_undo"/>
      <menuitem id="menu_redo"/>
      <menuseparator/>
      <menuitem id="menu_cut"/>
      <menuitem id="menu_copy"/>
      <menuitem id="menu_paste"/>
      <menuseparator/>
      <menuitem id="menu_selectAll"/>
      <menuseparator/>
      <menuitem id="menu_find"/>
      <menuitem id="menu_findAgain"/>
      <menuseparator/>
      <menuitem id="se-menu-gotoLine"
          label="&gotoLineCmd.label;"
          accesskey="&gotoLineCmd.accesskey;"
          key="key_gotoLine"
          command="cmd_gotoLine"/>
      <menuitem id="sp-menu-pprint"
          label="&pprint.label;"
          accesskey="&pprint.accesskey;"
          key="sp-key-pprint"
          command="sp-cmd-pprint"/>
    </menupopup>
  </menu>

  <menu id="sp-view-menu" label="&viewMenu.label;" accesskey="&viewMenu.accesskey;">
    <menupopup id="sp-menu-viewpopup">
      <menuitem id="sp-menu-line-numbers"
                label="&lineNumbers.label;"
                accesskey="&lineNumbers.accesskey;"
                type="checkbox"
                command="sp-cmd-line-numbers"/>
      <menuitem id="sp-menu-word-wrap"
                label="&wordWrap.label;"
                accesskey="&wordWrap.accesskey;"
                type="checkbox"
                command="sp-cmd-wrap-text"/>
      <menuitem id="sp-menu-highlight-trailing-space"
                label="&highlightTrailingSpace.label;"
                accesskey="&highlightTrailingSpace.accesskey;"
                type="checkbox"
                command="sp-cmd-highlight-trailing-space"/>
      <menuseparator/>
      <menuitem id="sp-menu-larger-font"
                label="&largerFont.label;"
                key="sp-key-larger-font"
                accesskey="&largerFont.accesskey;"
                command="sp-cmd-larger-font"/>
      <menuitem id="sp-menu-smaller-font"
                label="&smallerFont.label;"
                key="sp-key-smaller-font"
                accesskey="&smallerFont.accesskey;"
                command="sp-cmd-smaller-font"/>
      <menuitem id="sp-menu-normal-size-font"
                label="&normalSize.label;"
                key="sp-menu-normal-font"
                accesskey="&normalSize.accesskey;"
                command="sp-cmd-normal-font"/>
    </menupopup>
  </menu>

  <menu id="sp-execute-menu" label="&executeMenu.label;"
        accesskey="&executeMenu.accesskey;">
    <menupopup id="sp-menu_executepopup">
      <menuitem id="sp-text-run"
                label="&run.label;"
                accesskey="&run.accesskey;"
                key="sp-key-run"
                command="sp-cmd-run"/>
      <menuitem id="sp-text-inspect"
                label="&inspect.label;"
                accesskey="&inspect.accesskey;"
                key="sp-key-inspect"
                command="sp-cmd-inspect"/>
      <menuitem id="sp-text-display"
                label="&display.label;"
                accesskey="&display.accesskey;"
                key="sp-key-display"
                command="sp-cmd-display"/>
      <menuseparator/>
      <menuitem id="sp-text-reloadAndRun"
                label="&reloadAndRun.label;"
                key="sp-key-reloadAndRun"
                accesskey="&reloadAndRun.accesskey;"
                command="sp-cmd-reloadAndRun"/>
      <menuitem id="sp-text-evalFunction"
                label="&evalFunction.label;"
                key="sp-key-evalFunction"
                accesskey="&evalFunction.accesskey;"
                command="sp-cmd-evalFunction"/>
    </menupopup>
  </menu>

  <menu id="sp-environment-menu"
        label="&environmentMenu.label;"
        accesskey="&environmentMenu.accesskey;"
        hidden="true">
    <menupopup id="sp-menu-environment">
      <menuitem id="sp-menu-content"
                label="&contentContext.label;"
                accesskey="&contentContext.accesskey;"
                command="sp-cmd-contentContext"
                checked="true"
                type="radio"/>
      <menuitem id="sp-menu-browser"
                command="sp-cmd-browserContext"
                label="&browserContext.label;"
                accesskey="&browserContext.accesskey;"
                type="radio"/>
    </menupopup>
  </menu>

#ifdef XP_WIN
  <menu id="sp-help-menu"
        label="&helpMenu.label;"
        accesskey="&helpMenuWin.accesskey;">
#else
  <menu id="sp-help-menu"
        label="&helpMenu.label;"
        accesskey="&helpMenu.accesskey;">
#endif
    <menupopup id="sp-menu-help">
      <menuitem id="sp-menu-documentation"
                label="&documentationLink.label;"
                accesskey="&documentationLink.accesskey;"
                command="sp-cmd-documentationLink"
                key="key_openHelp"/>
    </menupopup>
  </menu>
</menubar>

<toolbar id="sp-toolbar"
         class="devtools-toolbar">
  <toolbarbutton id="sp-toolbar-open"
                 class="devtools-toolbarbutton"
                 label="&openFileCmd.label;"
                 command="sp-cmd-openFile"/>
  <toolbarbutton id="sp-toolbar-save"
                 class="devtools-toolbarbutton"
                 label="&saveFileCmd.label;"
                 command="sp-cmd-save"/>
  <toolbarbutton id="sp-toolbar-saveAs"
                 class="devtools-toolbarbutton"
                 label="&saveFileAsCmd.label;"
                 command="sp-cmd-saveas"/>
  <toolbarspacer/>
  <toolbarbutton id="sp-toolbar-run"
                 class="devtools-toolbarbutton"
                 label="&run.label;"
                 command="sp-cmd-run"/>
  <toolbarbutton id="sp-toolbar-inspect"
                 class="devtools-toolbarbutton"
                 label="&inspect.label;"
                 command="sp-cmd-inspect"/>
  <toolbarbutton id="sp-toolbar-display"
                 class="devtools-toolbarbutton"
                 label="&display.label;"
                 command="sp-cmd-display"/>
  <toolbarspacer/>
  <toolbarbutton id="sp-toolbar-pprint"
                 class="devtools-toolbarbutton"
                 label="&pprint.label;"
                 command="sp-cmd-pprint"/>
</toolbar>


<popupset id="scratchpad-popups">
  <menupopup id="scratchpad-text-popup">
    <menuitem id="cMenu_cut"/>
    <menuitem id="cMenu_copy"/>
    <menuitem id="cMenu_paste"/>
    <menuitem id="cMenu_delete"/>
    <menuseparator/>
    <menuitem id="cMenu_selectAll"/>
    <menuseparator/>
    <menuitem id="sp-text-run"
              label="&run.label;"
              accesskey="&run.accesskey;"
              key="sp-key-run"
              command="sp-cmd-run"/>
    <menuitem id="sp-text-inspect"
              label="&inspect.label;"
              accesskey="&inspect.accesskey;"
              key="sp-key-inspect"
              command="sp-cmd-inspect"/>
    <menuitem id="sp-text-display"
              label="&display.label;"
              accesskey="&display.accesskey;"
              key="sp-key-display"
              command="sp-cmd-display"/>
    <menuitem id="sp-text-evalFunction"
              label="&evalFunction.label;"
              key="sp-key-evalFunction"
              accesskey="&evalFunction.accesskey;"
              command="sp-cmd-evalFunction"/>
    <menuseparator/>
    <menuitem id="sp-text-reloadAndRun"
              label="&reloadAndRun.label;"
              key="sp-key-reloadAndRun"
              accesskey="&reloadAndRun.accesskey;"
              command="sp-cmd-reloadAndRun"/>
  </menupopup>
</popupset>

<notificationbox id="scratchpad-notificationbox" flex="1">
  <hbox flex="1">
    <vbox id="scratchpad-editor" flex="1"/>
    <splitter class="devtools-side-splitter"/>
    <tabbox id="scratchpad-sidebar" class="devtools-sidebar-tabs"
                                    width="300"
                                    hidden="true">
      <tabs/>
      <tabpanels flex="1"/>
    </tabbox>
  </hbox>
  <toolbar id="statusbar-line-col" class="devtools-toolbar"/>
</notificationbox>

</window>
